From ac553d7e44f44e161c204a04ab8480a9b619304c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 2 Nov 2015 23:06:57 -0500 Subject: [PATCH] check button: Match documented behavior We were not actually adding the style classes that the documentation is talking about, for the !draw-indicator case. Fix that. --- gtk/gtkcheckbutton.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index 16f0bf2c89..c1963f3e4b 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -169,16 +169,31 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS { gtk_button_set_alignment (button, 0.0, 0.5); gtk_css_node_set_visible (priv->indicator_node, TRUE); - if (GTK_IS_CHECK_BUTTON (button)) - gtk_css_node_set_name (widget_node, I_("checkbutton")); - else if (GTK_IS_RADIO_BUTTON (button)) - gtk_css_node_set_name (widget_node, I_("radiobutton")); + if (GTK_IS_RADIO_BUTTON (button)) + { + gtk_css_node_remove_class (widget_node, g_quark_from_static_string ("radio")); + gtk_css_node_set_name (widget_node, I_("radiobutton")); + } + else if (GTK_IS_CHECK_BUTTON (button)) + { + gtk_css_node_remove_class (widget_node, g_quark_from_static_string ("check")); + gtk_css_node_set_name (widget_node, I_("checkbutton")); + } } else { gtk_button_set_alignment (button, 0.5, 0.5); gtk_css_node_set_visible (priv->indicator_node, FALSE); - gtk_css_node_set_name (widget_node, I_("button")); + if (GTK_IS_RADIO_BUTTON (button)) + { + gtk_css_node_add_class (widget_node, g_quark_from_static_string ("radio")); + gtk_css_node_set_name (widget_node, I_("button")); + } + else if (GTK_IS_CHECK_BUTTON (button)) + { + gtk_css_node_add_class (widget_node, g_quark_from_static_string ("check")); + gtk_css_node_set_name (widget_node, I_("button")); + } } G_GNUC_END_IGNORE_DEPRECATIONS } -- 2.30.2